<%@page import="com.hhit.collaborative_learning.dao.impl.PublicDaoImplMySql"%>
<%@page import="com.hhit.collaborative_learning.entity.DataList"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	PublicDaoImplMySql dao=new PublicDaoImplMySql();
	DataList datalist=dao.getDataList();
	request.setAttribute("dataList", datalist);
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<%=basePath %>css/download.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet"
	href="<%=basePath %>css/index.css">
<script src="<%=basePath %>js/jquery-1.11.1.min.js"
	type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="<%=basePath %>css/News-nav.css">
<!-- toolbar nav -->
<script language='JavaScript' type='text/javascript'
	src='<%=basePath %>js/jquery.form.js'></script>
<script language='JavaScript' type='text/javascript'
	src='<%=basePath %>js/jquery.cookie.js'></script>
</head>
<body>
	<div class="news-nav">
		<div class="container clearfix">
			<div class="nav-bar">
				<a href="<%=basePath %>download/download.jsp" target="_top" class="current">首页</a> 
				<a href="<%=basePath %>download/mydata.jsp" onclick="checkLogin()">我的资源</a>
				<a href="<%=basePath%>download/search.jsp?type=3" target="_blank">搜索</a>
			</div>
		</div>
	</div>
	<!-- //toolbar nav -->
	<div id="wrap">
		<div class="content">
			<div class="left">
				<div class="nav_side">
					<ul id='mouse_move'>
						<li><a href="<%=basePath %>download/category.jsp?type=mobile_development" class="mobile_development">移动开发</a></li>
						<li><a href="<%=basePath %>download/category.jsp?type=development_technology" class="development_technology">开发技术</a></li>
						<li><a href="<%=basePath %>download/category.jsp?type=course_resource" class="course_resource">课程资源</a></li>
						<li><a href="<%=basePath %>download/category.jsp?type=network_technology" class="network_technology">网络技术</a></li>
						<li><a href="<%=basePath %>download/category.jsp?type=operating_system" class="operating_system">操作系统</a></li>
						<li><a href="<%=basePath %>download/category.jsp?type=security_technology" class="security_technology">安全技术</a></li>
						<li><a href="<%=basePath %>download/category.jsp?type=database" class="database">数据库</a></li>
						<li><a href="<%=basePath %>download/category.jsp?type=industry" class="industry">行业</a></li>
						<li><a href="<%=basePath %>download/category.jsp?type=server" class="server">服务器应用</a></li>
						<li><a href="<%=basePath %>download/category.jsp?type=store" class="store">存储</a></li>
						<li><a href="<%=basePath %>download/category.jsp?type=information" class="information">信息化</a></li>
						<li class="last"><a href="<%=basePath %>download/category.jsp?type=examination_authentication"
							class="examination_authentication">考试认证</a></li>
					</ul>
					<div class="nav_side_lev2" style="display: none;"></div>
				</div>
				<!-- editor recommend -->
				<div class="bor_box_1 editor_recom">
					<h2>编辑推荐</h2>
					<ul class="recom_list">
						<c:forEach items="${dataList.recommendList }" var="data">
							<li><a title="${data.dataName}"
								href="<%=basePath %>download/downloadpage.jsp?dataId=${data.dataId}"
								target="_blank">${data.dataName}</a></li>
						</c:forEach>
					</ul>
				</div>
				<div class="bor_box_1 clear">
					<h2>
						热门分类资源推荐
					</h2>
					<div class="res_classfiy ">
						<h3>
							<a href="<%=basePath %>download/category.jsp?type=development_technology">开发技术</a><span class="gray_1">共有<dfn>${requestScope.dataList.development_technology_num }</dfn>个资源
							</span>
						</h3>
						<ul class="res_list">
							<c:forEach items="${dataList.development_technology}" var="data">
								<li><a title="${data.dataName}" href="<%=basePath %>download/downloadpage.jsp?dataId=${data.dataId}"
									target="_blank">${data.dataName}</a></li>
							</c:forEach>
						</ul>
					</div>
					<div class="res_classfiy ">
						<h3>
							<a href="<%=basePath %>download/category.jsp?type=course_resource">课程资源</a><span class="gray_1">共有<dfn>${dataList.course_resource_num}</dfn>个资源
							</span>
						</h3>
						<ul class="res_list">
							<c:forEach items="${dataList.course_resource}" var="data">
								<li><a title="${data.dataName}" href="<%=basePath %>download/downloadpage.jsp?dataId=${data.dataId}"
									target="_blank">${data.dataName}</a></li>
							</c:forEach>
						</ul>
					</div>
					<div class="res_classfiy ">
						<h3>
							<a href="<%=basePath %>download/category.jsp?type=mobile_development">移动开发</a><span class="gray_1">共有<dfn>${dataList.mobile_development_num}</dfn>个资源
							</span>
						</h3>
						<ul class="res_list">
							<c:forEach items="${dataList.mobile_development}" var="data">
								<li><a title="${data.dataName}" href="<%=basePath %>download/downloadpage.jsp?dataId=${data.dataId}"
									target="_blank">${data.dataName}</a></li>
							</c:forEach>
						</ul>
					</div>
					<div class="res_classfiy ">
						<h3>
							<a href="<%=basePath %>download/category.jsp?type=network_technology">网络技术</a><span class="gray_1">共有<dfn>${dataList.network_technology_num}</dfn>个资源
							</span>
						</h3>
						<ul class="res_list">
							<c:forEach items="${dataList.network_technology}" var="data">
								<li><a title="${data.dataName}"
									href="<%=basePath %>download/downloadpage.jsp?dataId=${data.dataId}" target="_blank">${data.dataName}</a></li>
							</c:forEach>
						</ul>
					</div>
					<div class="res_classfiy ">
						<h3>
							<a href="<%=basePath %>download/category.jsp?type=operating_system">操作系统</a><span class="gray_1">共有<dfn>${dataList.operating_system_num}</dfn>个资源
							</span>
						</h3>
						<ul class="res_list">
							<c:forEach items="${dataList.operating_system}" var="data">
								<li><a title="${data.dataName}"
									href="<%=basePath %>download/downloadpage.jsp?dataId=${data.dataId}" target="_blank">${data.dataName}</a></li>
							</c:forEach>
						</ul>
					</div>
					<div class="res_classfiy">
						<h3>
							<a href="<%=basePath %>download/category.jsp?type=industry">行业</a><span class="gray_1">共有<dfn>${dataList.industry_num}</dfn>个资源
							</span>
						</h3>
						<ul class="res_list">
							<c:forEach items="${dataList.industry}" var="data">
								<li><a title="${data.dataName}"
									href="<%=basePath %>download/downloadpage.jsp?dataId=${data.dataId}" target="_blank">${data.dataName}</a></li>
							</c:forEach>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
	function checkLogin(){
		if($.cookie("userId")){
			return true;
		}
		if(confirm("需要登录，是否登录?")){
			var links=top.location.href.substring(7).split("/");
			top.location.href="<%=basePath%>login.jsp?link="+encodeURIComponent(links[2]+"/"+links[3]);
			return false;
		}
		return false;
	}
	(function(){
	$(function(){
		var back_top_value =Math.ceil(document.documentElement.clientHeight *0.65);
		var float_ask_img="<div data-mod='popu_64' class='tracking-ad' chg-blk='0' ><a id='com-ask-float-block' target='_blank' title='文件上传' style='top:"+(back_top_value-41)+"px'></a></div>";
		$("body").append(float_ask_img);
		$("#com-ask-float-block").click(function(){
			if(checkLogin()){
				$(this).attr("href","<%=basePath%>download/upload.jsp");
			}
		});
	});
	})();
	</script>

	<link href="<%=basePath %>css/ask_float_block.css"
		rel="stylesheet" type="text/css" />
</body>
</html>
